import request from '@/utils/request'
import Cookies from 'js-cookie'
export function storeList(data) {
    return request({
        url: "/General/get_store/-1",
        method: "post",
        data: data
    })
}
export function houseList(data) {
    return request({
        url: "/Stock_check/get_channel",
        method: "post",
        data: data
    })
}
// 列表
export function getList(data) {
    return request({
        url: '/Stock_check/check_list',
        method: 'post',
        data: data
    })
}
// 提交保存
export function save(data,url) {
    return request({
        url: url,
        method: 'post',
        data: data
    })
}
//搜索添加礼品
export function searchGift(data) {
    return request({
        url: '/Stock_check/add_gift_check',
        method: 'post',
        data: data
    })
}
//导入功能  在请求头设置了转换成后端需要的字符串，请求暂时写在VUE文件里
// export function importForm(data) {
//     return request({
//         url:`/Stock_check/back_csv`,
//         method: 'post',
//         data: data
//     })
// }
// 导出
export function getExport(data) {
    window.location.href = `https://${location.host}/smsi/index.php/Stock_check/get_excel?store_id=${data.store_id}&warehouse=${data.warehouse}&house_id=${data.house_id}&orderby=1&gift_no=${data.gift_no}&gift_name=${data.gift_name}&didixueshengka=${Cookies.get('SMS_AdminToken')}`; 
}
